﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IChangeCategoryCtrl" in both code and config file together.
[ServiceContract]
public interface IChangeCategoryCtrl
{
    [OperationContract]
    List<Category> GetAllCate();

    [OperationContract]
    void AddCate(Guid categoryID, String categoryName, Boolean categoryStatus, Guid categoryFather);

    [OperationContract]
    void MergeCate(Guid categoryID1, Guid categoryID2);

}

[DataContract]
public class Category
{
    Guid categoryID;
    [DataMember]
    public Guid CategoryID
    {
        get { return categoryID; }
        set { categoryID = value; }
    }

    String categoryName;
    [DataMember]
    public String CategoryName
    {
        get { return categoryName; }
        set { categoryName = value; }
    }

    Boolean categoryStatus;
    [DataMember]
    public Boolean CategoryStatus
    {
        get { return categoryStatus; }
        set { categoryStatus = value; }
    }

    Guid categoryFather;
    [DataMember]
    public Guid CategoryFather
    {
        get { return categoryFather; }
        set { categoryFather = value; }
    }

    public Category(Category_Table catecopy)
    {
        categoryID = catecopy.CategoryID;
        categoryName = catecopy.CategoryName;
        categoryStatus = catecopy.CategoryStatus;
        categoryFather = catecopy.CategoryFather;
    }
}
